<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'shop-form',
	'enableAjaxValidation'=>false,
        'htmlOptions' => array('enctype' => 'multipart/form-data'),
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'price'); ?>
		<?php echo $form->textField($model,'price',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'price'); ?>
	</div>
        <div class="row">
		<?php echo $form->labelEx($model,'purchase'); ?>
                <?php echo $form->textArea($model,'purchase',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'purchase'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'discription'); ?>
		<?php echo $form->textArea($model,'discription',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'discription'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'image'); ?>
                <?php 
                if($model->image != null){
                    echo CHtml::image($model->thumbnail,$model->title,array('width'=>'80','height'=>'60'));
                    echo '<br/>';
                }
                echo CHtml::activeFileField($model, 'image_file'); ?>
		<?php echo $form->error($model,'image_file'); ?>
	</div>

	<div class="row">
            <?php
                $category_array = CHtml::listData(ShopCategory::model()->findAll(), "id", "name");
                ?>
                <?php echo $form->labelEx($model,'category'); ?>
                <?php echo $form->listBox($model,'category',$category_array); ?>
                <?php echo $form->error($model,'category'); ?>
	</div>

	<div class="row">
            <?php
                $artist_array = CHtml::listData(Artist::model()->findAll(), "id", "name");
                ?>
                <?php echo $form->labelEx($model,'artist'); ?>
                <?php echo $form->listBox($model,'artist',$artist_array); ?>
                <?php echo $form->error($model,'artist'); ?>
	</div>

    <!--<div class="row">
            <?php
                $home_array = CHtml::listData(Home::model()->findAll(), "id", "name");
                ?>
                <?php echo $form->labelEx($model,'show_home'); ?>
                <?php echo $form->listBox($model,'show_home',$home_array); ?>
                <?php echo $form->error($model,'show_home'); ?>
	</div>-->
        
	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->